import request from '@/utils/request'

export function homeApi () {
  return request.get('/index/index')
}

export function articleHotApi (data) {
  return request.get('/index/new', { params: data })
}

export function newArticleApi () {
  return request.get('/index/hot')
}

// 详情
export function detailApi (id) {
  return request.get('/index/show', { params: id })
}

// 文章发布
export function addArticleApi (data) {
  return request({
    method: 'post',
    url: '/user/addArticle',
    data
  })
}
// 上传头像
export function updataImgApi (data) {
  return request({
    method: 'post',
    url: '/common/upload?type=images',
    data
  })
}
